/**
 * Copyright &copy; 2015-2020 <a href="http://www.easyhis.com/">easyhis</a> All rights reserved.
 */
package com.easy.dfcshop.entity;

import com.easy.common.utils.IdGen;
import com.easy.common.utils.excel.annotation.ExcelField;
import com.easy.core.persistence.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 厂家的活动报名表Entity
 * @author waylen chi
 * @version 2018-01-11
 */
public class ActivityEnroll extends BaseEntity<ActivityEnroll> {
	
	private static final long serialVersionUID = 1L;
	private Integer enrollId;		// ID自增
	private String id;		// 报名活动UUID
	private Integer storeId;		// 厂家ID
	private Integer typeId;		// 活动类型ID
	private Integer activityId;		// 活动id
	private String contactPhone;		// 联系电话
	private String contactName;		// 联系人
	private Date startTime;		// 商家报名参加活动的开始时间
	private Date endTime;		// 商家报名参加活动的结束时间
	private Date payAmntTime;		// 支付时间
	private BigDecimal amnt;		// 所需费用
	private Date payDepositTime;		// pay_deposit_time
	private BigDecimal deposit;		// 活动保证金
	private String status;		// 报名状态 (1待审核,2审核通过待缴费，3审核不通过，4撤回，5报名成功)
	private String tradeNo;		// 订单号
	private Date createTime;		// 创建时间
	private Integer createId;		// 创建人
	private Date updateTime;		// 更新时间
	private Integer updateId;		// 更新人
	private String delFlag;		// 删除标志
	
	public ActivityEnroll() {
		super();
	}

	public ActivityEnroll(String id){
		this.id = id;
	}

	@NotNull(message="ID自增不能为空")
	@ExcelField(title="ID自增", align=2, sort=0)
	public Integer getEnrollId() {
		return enrollId;
	}

	public void setEnrollId(Integer enrollId) {
		this.enrollId = enrollId;
	}
	
	@ExcelField(title="报名活动UUID", align=2, sort=1)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	@ExcelField(title="厂家ID", align=2, sort=2)
	public Integer getStoreId() {
		return storeId;
	}

	public void setStoreId(Integer storeId) {
		this.storeId = storeId;
	}
	
	@ExcelField(title="活动类型ID", align=2, sort=3)
	public Integer getTypeId() {
		return typeId;
	}

	public void setTypeId(Integer typeId) {
		this.typeId = typeId;
	}
	
	@ExcelField(title="活动id", align=2, sort=4)
	public Integer getActivityId() {
		return activityId;
	}

	public void setActivityId(Integer activityId) {
		this.activityId = activityId;
	}
	
	@ExcelField(title="联系电话", align=2, sort=5)
	public String getContactPhone() {
		return contactPhone;
	}

	public void setContactPhone(String contactPhone) {
		this.contactPhone = contactPhone;
	}
	
	@ExcelField(title="联系人", align=2, sort=6)
	public String getContactName() {
		return contactName;
	}

	public void setContactName(String contactName) {
		this.contactName = contactName;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="商家报名参加活动的开始时间", align=2, sort=7)
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="商家报名参加活动的结束时间", align=2, sort=8)
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="支付时间", align=2, sort=9)
	public Date getPayAmntTime() {
		return payAmntTime;
	}

	public void setPayAmntTime(Date payAmntTime) {
		this.payAmntTime = payAmntTime;
	}
	
	@ExcelField(title="所需费用", align=2, sort=10)
	public BigDecimal getAmnt() {
		return amnt;
	}

	public void setAmnt(BigDecimal amnt) {
		this.amnt = amnt;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="pay_deposit_time", align=2, sort=11)
	public Date getPayDepositTime() {
		return payDepositTime;
	}

	public void setPayDepositTime(Date payDepositTime) {
		this.payDepositTime = payDepositTime;
	}
	
	@ExcelField(title="活动保证金", align=2, sort=12)
	public BigDecimal getDeposit() {
		return deposit;
	}

	public void setDeposit(BigDecimal deposit) {
		this.deposit = deposit;
	}
	
	@ExcelField(title="报名状态 (1待审核,2审核通过待缴费，3审核不通过，4撤回，5报名成功)", align=2, sort=13)
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@ExcelField(title="订单号", align=2, sort=14)
	public String getTradeNo() {
		return tradeNo;
	}

	public void setTradeNo(String tradeNo) {
		this.tradeNo = tradeNo;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="创建时间", align=2, sort=15)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@ExcelField(title="创建人", align=2, sort=16)
	public Integer getCreateId() {
		return createId;
	}

	public void setCreateId(Integer createId) {
		this.createId = createId;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="更新时间", align=2, sort=17)
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	@ExcelField(title="更新人", align=2, sort=18)
	public Integer getUpdateId() {
		return updateId;
	}

	public void setUpdateId(Integer updateId) {
		this.updateId = updateId;
	}
	
	@ExcelField(title="删除标志", dictType="del_flag", align=2, sort=19)
	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}
	/**
	 * 更新之前执行方法，需要手动调用
	 */
	public void preUpdate(){
		this.updateTime = new Date();
	}
	/**
	 * 插入之前执行方法，需要手动调用
	 */
	public void preInsert(Date now){
		this.id = IdGen.uuid();

		this.updateTime = now;
		this.createTime = this.updateTime;
	}

	public void preInsert(){
		this.id = IdGen.uuid();
		Date now = new Date();
		this.updateTime = now;
		this.createTime = this.updateTime;
	}
	/**
	 * 更新之前执行方法，需要手动调用
	 */
	public void preUpdate(Date now){
		this.updateTime = now;
	}

}